/**
 * Created by bian on 2015/12/28.
 */
var path = require('path');
var fs = require('fs');
var Sequelize = require('sequelize');

var sequelize = new Sequelize(require('../config').db.toString());
fs
    .readdirSync( __dirname)
    .filter(function (file) {
        return (file.indexOf('.') !== 0) && (file !== 'index.js' &&  file !== 'migration.js');
    })
    .forEach(function (file) {
        sequelize.import( path.join(__dirname, file));
    });

module.exports = sequelize;
